import { createStore } from 'vuex'

export default createStore({
  state: {
    userinfo:{
      name:"张三"
    }
  },
  mutations: {
    setName(state,val){
      console.log("vuex的mutations设置name："+val)
      state.userinfo.name=val
    },
  },
  actions: {
    setName({commit},val){
      commit("setName", val);
    }
  },
  modules: {
  }
})
